﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AAA.TradeLanguage.Data
{
    public class PerformanceSummary
    {
        private float _fTotalNetProfit;

        public float TotalNetProfit
        {
            get { return _fTotalNetProfit; }
            set { _fTotalNetProfit = value; }
        }
        private float _fGrossProfit;

        public float GrossProfit
        {
            get { return _fGrossProfit; }
            set { _fGrossProfit = value; }
        }
        private float _fGrossLoss;

        public float GrossLoss
        {
            get { return _fGrossLoss; }
            set { _fGrossLoss = value; }
        }
        private int _iTotalTradeCount;

        public int TotalTradeCount
        {
            get { return _iTotalTradeCount; }
            set { _iTotalTradeCount = value; }
        }

        public float PercentProfitable
        {
            get { return TotalTradeCount > 0 ? (float)(((double)WinningTradeCount / (double)TotalTradeCount) * 100.0) : (float)0; }
        }
        private int _iWinningTradeCount;

        public int WinningTradeCount
        {
            get { return _iWinningTradeCount; }
            set { _iWinningTradeCount = value; }
        }
        private int _iLosingTradeCount;

        public int LosingTradeCount
        {
            get { return _iLosingTradeCount; }
            set { _iLosingTradeCount = value; }
        }

        private float _fLargestWinningTrade;
        public float LargestWinningTrade
        {
            get { return _fLargestWinningTrade; }
            set { _fLargestWinningTrade = value; }
        }

        private float _fLargestLosingTrade;
        public float LargestLosingTrade
        {
            get { return _fLargestLosingTrade; }
            set { _fLargestLosingTrade = value; }
        }

        public float AverageWinningTrade
        {
            get { return (float)(GrossProfit / WinningTradeCount) ; }
        }

        public float AverageLosingTrade
        {
            get { return (float)(GrossLoss / LosingTradeCount); }
        }

        public float AverageWinLossRatio
        {
            get { return Math.Abs(AverageWinningTrade / AverageLosingTrade); }
        }

        public float AverageTrade
        {
            get { return (float)((GrossProfit + GrossLoss) / TotalTradeCount); }
        }
        private int _iMaxConsecWinner;

        public int MaxConsecWinner
        {
            get { return _iMaxConsecWinner; }
            set { _iMaxConsecWinner = value; }
        }
        private int _iMaxConsecLoser;

        public int MaxConsecLoser
        {
            get { return _iMaxConsecLoser; }
            set { _iMaxConsecLoser = value; }
        }

        private int _iConsecWinner;

        public int ConsecWinner
        {
            get { return _iConsecWinner; }
            set { _iConsecWinner = value; }
        }

        private int _iConsecLoser;

        public int ConsecLoser
        {
            get { return _iConsecLoser; }
            set { _iConsecLoser = value; }
        }
    }
}
